<style>
    .fieldlist dd input:first-child {
        width: 45% !important;
    }

    .form-group .json_list,
    .answer {
        display: flex;
    }

    .form-group .json_list {
        margin: 5px 0;
    }

    .json_left {
        width: 80%;
        padding-right: 5px;
    }

    .answer {
        margin-top: 10px;
    }
</style>
<div class="alert {$addon.tips.extend|default='alert-info-light'}" style="margin-bottom:10px;">
    {:__('Test is divided into grade and jump type, grade 1, types of tests. Add the topic you just need to add result and score range. 2, jump type test, add the subject need to jump and jump results! 0 no processing!')}
</div>
<div class="row">
    <div class="col-xs-12 col-sm-6 col-md-5 col-lg-4">
        <div class="panel panel-default panel-intro">
            <div class="panel-body">
                <div id="1" class="tab-content">
                    <div class="tab-pane fade active in" id="one">
                        <div class="widget-body no-padding">
                            <div id="toolbar" class="toolbar">
                                {:build_toolbar('refresh')}
                                <a class="btn btn-info btn-disabled disabled btn-selected" href="javascript:;">
                                    <i class="fa fa-leaf"></i>
                                    {:__('Selection problem')}
                                </a>
                            </div>
                            <table id="table" class="table table-striped table-bordered table-hover" width="100%">

                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="col-xs-12 col-sm-6 col-md-7 col-lg-8">
        <div class="panel panel-default panel-intro">
            <div class="panel-body">
                <input type="hidden" id="question_ids" value="{$question_ids}">
                <form id="add-form" class="form-horizontal" role="form" data-toggle="validator" method="POST"
                    action="{:url('mental/test_main/edit_info',array('ids'=>$row.id))}">

                    <div class="form-group row">
                        <label class="control-label col-xs-12 col-sm-2">{:__('Question')}:</label>
                        <div class="col-xs-12 col-sm-8" id="question">
                            {foreach name="question" item="item"}
                            <div class="json_list">
                                <div class="json_left">
                                    <div class="question">
                                        <input type="text" class="form-control"
                                            value="{$item.question_id}、{$item.title}" readonly />
                                        <input type="hidden" name="row[{$key}][id]" value="{$item.question_id}" />
                                        
                                    </div>
                                    {foreach name="item['question_text']" key="ik" item="it"}
                                    <div class="answer">
                                        <input type="text" class="form-control" value="{$it.option}：{$it.intro}" readonly />
                                        
                                        <input type="text" class="form-control" style="width: 76px;" value="维度: {$it.dimension}" readonly />
                                        <input type="hidden" name="row[{$key}][option][{$ik}]" value="{$it.option}" />
                                        <input type="hidden" name="row[{$key}][skip][{$ik}]" class="form-control"
                                            value="{if isset($item['skip'][$ik])} {$item['skip'][$ik]}{/if}"
                                            style="margin: 0 3px;" placeholder="{:__('Jump topic')}"
                                            data-toggle="tooltip" data-placement="bottom" title="跳转类型时的跳转题目(分数类型可忽略)" />
                                        <input type="hidden" name="row[{$key}][result][{$ik}]" class="form-control"
                                            value="{if isset($item['result'][$ik])}{$item['result'][$ik]}{/if}"
                                            placeholder="{:__('Jump results')}" data-toggle="tooltip"
                                            data-placement="bottom" title="跳转类型时的跳转结果(分数类型可忽略)" />
                                    </div>
                                    {/foreach}
                                </div>
                                <div>
                                    <span class="btn btn-sm btn-danger btn-remove" data-question="{$item.question_id}">
                                        <i class="fa fa-times"></i>
                                    </span>
                                    <span class="btn btn-sm btn-primary btn-dragsort">
                                        <i class="fa fa-arrows"></i>
                                    </span>
                                </div>
                            </div>
                            {/foreach}
                        </div>
                    </div> 

                    <!--<div class="form-group row">-->
                    <!--    <label class="control-label col-xs-12 col-sm-2">{:__('Result')}:</label>-->
                    <!--    <div class="col-xs-12 col-sm-8">-->
                    <!--        <dl class="fieldlist" data-template="content_tpl" data-name="result">-->
                    <!--            <dd>-->
                    <!--                <a href="javascript:;" class="btn btn-sm btn-success btn-append">-->
                    <!--                    <i class="fa fa-plus"></i>-->
                    <!--                    {:__('Append')}-->
                    <!--                </a>-->
                    <!--            </dd>-->
                                <!--请注意 dd和textarea间不能存在其它任何元素，实际开发中textarea应该添加个hidden进行隐藏-->
                    <!--            <textarea name="result" class="form-control hide" cols="30"-->
                    <!--                rows="5">{if !empty($result)}{$result['content']}{/if}</textarea>-->
                    <!--        </dl>-->
                    <!--        <script id="content_tpl" type="text/html">-->
                    <!--            <dd class="form-inline json_list">  -->
                    <!--            {if $row.type == 'skip'}-->
                    <!--                <div class="json_left">-->
                    <!--                    <input type="text" name="<%=name%>[<%=index%>][key]" class="form-control" value="<%=row.key%>" style="width: 28% !important;" placeholder="{:__('Number')}" data-toggle="tooltip" data-placement="bottom" title="结果序号（为数字）"/>-->
                    <!--                    <input type="text" name="<%=name%>[<%=index%>][title]" class="form-control" value="<%=row.title%>" placeholder="{:__('Title')}" data-toggle="tooltip" data-placement="bottom" title="结果标题"/>                                  -->
                    <!--                    <textarea name="<%=name%>[<%=index%>][content]" class="form-control" cols="36" rows="3" style="margin-top:10px;vertical-align: top;" data-toggle="tooltip" data-placement="bottom" title="结果内容"><%=row.content%></textarea>-->
                    <!--                </div>  -->
                    <!--            {else/}-->
                    <!--                <div class="json_left">-->
                    <!--                    <input type="text" name="<%=name%>[<%=index%>][title]" class="form-control" value="<%=row.title%>" placeholder="{:__('Title')}" data-toggle="tooltip" data-placement="bottom" title="结果标题"/>                  -->
                    <!--                    <input type="text" name="<%=name%>[<%=index%>][left]" class="form-control" value="<%=row.left%>" placeholder="{:__('Left range fraction')}" size="2" data-toggle="tooltip" data-placement="bottom" title="左区间分数"/>-->
                    <!--                    <input type="text" name="<%=name%>[<%=index%>][right]" class="form-control" value="<%=row.right%>" placeholder="{:__('The right range scores')}" size="2" data-toggle="tooltip" data-placement="bottom" title="右区间分数"/>   -->
                    <!--                    <textarea name="<%=name%>[<%=index%>][content]" class="form-control" cols="36" rows="3" style="margin-top:10px;vertical-align: top;" data-toggle="tooltip" data-placement="bottom" title="结果内容"><%=row.content%></textarea>-->
                    <!--                </div>  -->
                    <!--            {/if}-->
                    <!--            <div style="line-height: 105px;">-->
                                        <!--下面的两个按钮务必保留-->
                    <!--                <span class="btn btn-sm btn-danger btn-remove">-->
                    <!--                    <i class="fa fa-times"></i>-->
                    <!--                </span>-->
                    <!--                <span class="btn btn-sm btn-primary btn-dragsort">-->
                    <!--                    <i class="fa fa-arrows"></i>-->
                    <!--                </span>-->
                    <!--            </div>-->
                    <!--            </dd>-->
                    <!--        </script>-->
                    <!--    </div>-->
                    <!--</div>-->

                    <div class="form-group layer-footer">
                        <label class="control-label col-xs-12 col-sm-2"></label>
                        <div class="col-xs-12 col-sm-8">
                            <button type="submit" class="btn btn-success btn-embossed disabled">{:__('OK')}</button>
                            <button type="reset" class="btn btn-default btn-embossed">{:__('Reset')}</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>

<script id="customformtpl" type="text/html">
    <!--form表单必须添加form-commsearch这个类-->
<form action="" class="form-commonsearch">
    <div style="border-radius:2px;margin-bottom:10px;background:#f5f5f5;padding:15px 20px;">
        <div class="row">
            <div class="col-xs-12 col-sm-6">
                <div class="form-group">
                    <label class="control-label">标题</label>
                    <!--隐式的operate操作符，必须携带一个class为operate隐藏的文本框,且它的data-name="字段",值为操作符-->
                    <input class="operate" type="hidden" data-name="title" value="like" />
                    <div>
                        <input class="form-control" type="text" name="title" placeholder="请输入查找的标题" value="" />
                    </div>
                </div>
            </div>

            <div class="col-xs-12 col-sm-6">
                <div class="form-group">
                    <label class="control-label">类型</label>
                    <input type="hidden" class="form-control operate" name="type-operate" data-name="type" value="=">
                    <div>
                        <select class="form-control" name="type">
                            <option value="">选择</option>
                            <option value="skip">跳转</option>
                            <option value="mark">打分</option>
                        </select>
                    </div>
                </div>
            </div>


            <div class="col-xs-12 col-sm-6">
                <div class="form-group">
                    <label class="control-label">分类</label>
                    <input type="hidden" class="form-control operate" name="type-operate" data-name="category_id"
                        value="=">
                    <div>
                        <input id="c-name" data-rule="required" data-field="name" data-source="mental/category/index"
                            class="form-control selectpage" name="category_id" type="text" value="">
                    </div>
                </div>
            </div>

            <div class="col-xs-12 col-sm-6">
                <div class="form-group">
                    <label class="control-label">创建时间</label>
                    <input type="hidden" class="operate" data-name="createtime" value="RANGE" />
                    <div>
                        <input type="text" class="form-control datetimerange" name="createtime" value="" />
                    </div>
                </div>
            </div>
            <div class="col-xs-12 col-sm-6">
                <div class="form-group">
                    <label class="control-label"></label>
                    <div class="row">
                        <div class="col-xs-6">
                            <input type="submit" class="btn btn-success btn-block" value="提交" />
                        </div>
                        <div class="col-xs-6">
                            <input type="reset" class="btn btn-primary btn-block" value="重置" />
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>
</script>